{if isset($smarty.session.pluginreport)}
  <strong><font color="#990000" >{$smarty.session.pluginreport}</font></strong>
{/if}
{literal}
<script language="JavaScript" type="text/javascript">
function insImage(src)
{
//  window.opener.document.forms.imageForm.src.value=src;
//  window.opener.document.getElementById('src').value=src;
  parent.document.getElementById('src').value=src;
parent.mcTabs.displayTab('general_tab','general_panel');
parent.ImageDialog.showPreviewImage(src);
//  window.close();
}
function delItem()
{return confirm('You are about to delete image.\r\n Are you sure you want to do this?')
}
function toogle(id, id2)
{var obj=document.getElementById(id);var obj2=document.getElementById(id2);if(obj.style.display=='none'){obj.style.display='';obj2.className="mceButtonOver";}else{obj.style.display='none';obj2.className="mceButton";}
}
</script>

<style type="text/css">
html {background:#F0F0EE;}
td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
textarea {resize:none;outline:none;}
a:link, a:visited {color:black;}
a:hover {color:#2B6FB6;}
table#manager {
  background-color: #fff;
}
/* Forms */
fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}
legend {color:#2B6FB6; font-weight:bold;}
label.msg {display:none;}
input {background:#FFF; border:1px solid #CCC;}
input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
input, select, textarea {border:1px solid #808080;}

/* Buttons */
input.insert, #cancel, input.button, .updateButton {
border:0; margin:0; padding:0;
font-weight:bold;
width:70px; height:26px;
background-color:/*url(http://magazinomania.ru/default/img/buttons.png) 0 -26px;*/#red;
cursor:pointer;
padding-bottom:2px;
}

</style>

{/literal}
<table id='manager' border="1" width="100%" cellpadding="4" cellspacing="0">
  <tbody><tr>
     <td>
     Create new folder&nbsp;
       <form action="" method="POST">
         <input class='invalid' name="new_folder_name" value="" type="text">&nbsp;
         <input style="cursor: pointer; background-color: #e1dfdd;" name="create_new_folder" value="Create" type="submit">
       </form>
     </td>
     <td>

     Upload file&nbsp;
       <form action="" enctype="multipart/form-data" method="POST">
         <input name="new_img" value="" type="file">&nbsp;
         <input style="cursor: pointer; background-color: #e1dfdd;" name="upload_img" value="Upload" type="submit">
       </form>
     </td>


  </tr>

  <tr valign="top">
    <td width="200">Folders:&nbsp;<br /><a href="/tinymceimagemanager/">..</a>
      {foreach item=item key=key from=$folders}
        <br />
        <form method="POST" name="form_{$item}">
          <input type="hidden" value="{$item}" name="del_folder" />
          <img src="/i/close.gif" onclick="document.form_{$item}.submit();"/>&nbsp;<a href="dir.{$item}.html">{$item}</a>
        </form>
      {/foreach}
    </td>
    <td  valign="top">Images{if isset($smarty.get.dir)} of folder "{$smarty.get.dir}"{/if}:<br />
      <table border="1">
        <tr>
          {foreach item=item key=key from=$imgs name=ii}
            <td width=100 height="100" align="center">
              <img  border="1" src="{$item.src}" width="{$item.w}" height="{$item.h}" style="cursor:pointer;" onClick="insImage('{$htp}{$item.src}');" />
              <form method="POST" name="f{$key}">
                <input class=insert' type="hidden" value="{$item.src}" name="del_img_src" />
                <input onclick="forms.f{$key}.submit();" style="cursor: pointer; width: 60px; text-align: center; background-color: #ecccc4; margin: 4px 0;" value="Delete">
              </form>
            </td>
            {if $smarty.foreach.ii.iteration%4 == 0}
              </tr>
              <tr>
            {/if}
          {/foreach}
        </tr>
      </table>
    </td>

  </tr>
</table>
</body>